﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Order_NewOrder" Codebehind="NewOrder.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>

    <script src="../Include/JS/Lib/jquery-1.1.4.js"></script>

    <script src="../Include/JS/Address.js"></script>

    <script src="../Include/JS/PopupCalendar.js"></script>

    <script src="../Include/JS/calendar.js"></script>

    <script type="text/javascript">
   var  $j = jQuery.noConflict();
function format(n)	//格式化数字为两位字符表示
{
	var m=new String();
	var tmp=new String(n);
	if (n<10 && tmp.length<2)
	{
		m="0"+n;
	}
	else
	{
		m=n;
	}
	return m;
}
   function formatdate(objDate,haveTime)
   {
	var meizzTheYear		= objDate.getFullYear();
	var meizzTheMonth	= objDate.getMonth()+1;
	var meizzTheDate		= objDate.getDate();
	var meizzTheHour		= objDate.getHours();
	var meizzTheMinute	= objDate.getMinutes();
	var meizzTheSecond	=objDate.getSeconds();
	var meizzTheSecond		= objDate.getSeconds();

	if (meizzTheMonth<10 && meizzTheMonth.length<2)	//格式化成两位数字
	{
		meizzTheMonth="0"+meizzTheMonth;
	}
	if (meizzTheDate<10 && meizzTheDate.length<2)	//格式化成两位数字
	{
		meizzTheDate="0"+meizzTheDate;
	}	
	var newDate="1753-01-01 00:00:000";
	if (haveTime)
	{
		newDate= meizzTheYear + "-" + format( meizzTheMonth) + "-" + 
							format(meizzTheDate) + " " + format(meizzTheHour) + ":" + 
							format(meizzTheMinute) + ":" + format(meizzTheSecond); 
							//注：在这里你可以输出改成你想要的格式
	}
	else
	{
		newDate= meizzTheYear + "-" + format( meizzTheMonth) + "-" + 
							format(meizzTheDate); //注：在这里你可以输出改成你想要的格式
	}
	return newDate;
   }
   function LiQuanInit(UserCode)
   {
        $j.post("../Handler/LiQuanHandler.ashx",{UserCode:UserCode},function(data){
        document.getElementById("LiQuanList").innerHTML=data;
        
        });
   }
    function GetList(p)
    {
        var sprows=document.getElementById("Hid_SpRows").value;
         document.getElementById("div_loadding").innerHTML = "<span >Loading  <img src='../Include/Images/loadimg.gif'></span>";
          $j.post("../Handler/OrderProductHandler.ashx?spdm="+p,{Rows:sprows}, function(data){       
           addRow(data);
           document.getElementById("div_loadding").innerHTML ="";
        });
    }
    function GetZFList()
    {
        var p=document.getElementById("selectJYLX");
        var jylx=p.options[p.options.selectedIndex].value;
         document.getElementById("div_loadding").innerHTML = "<span >Loading  <img src='../Include/Images/loadimg.gif'></span>";
          $j.post("../Handler/OrderProductHandler.ashx?jylx="+jylx,null, function(data){       
        var s=document.getElementById("tabZF");
        s.innerHTML+=data;
           document.getElementById("div_loadding").innerHTML ="";
        });
    }    
       function setVIPValue(p)
       {
            var gk=p.split("|");
            document.getElementById("TextBox2").innerText=gk[0];
             document.getElementById("TextBox1").innerText=gk[1];
             document.getElementById("TextBox3").innerText=gk[2];
             document.getElementById("TextBox4").innerText=gk[3];
             document.getElementById("div_dzlb").style.display="";
            AddressInit(gk[0]);
            LiQuanInit(gk[0]);
            Suan("s");
       }
       function setValue(p)
       {            
            GetList(p);
            var rows=document.getElementById("Hid_SpRows").value;
            var sp=p.split("|");            
            document.getElementById("Hid_SpRows").value=parseInt(rows)+sp.length;
       }    

   function addRow(tr)
   {
        var s=document.getElementById("tabProduct");
        s.innerHTML+=tr;
        Suan("s");
   }
   function Suan(p)
   {//debugger;
        var zje=0;
        var zzl=0;
        var s=document.getElementById("tabProduct");
        if(p!="")
        {
            for(var i=1;i<s.childNodes.length;i++)
            {
                if(document.getElementById("zk_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value=="1")
                {
                 document.getElementById("zk_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value=document.getElementById("TextBox1").value
                }
            }           
        }
        
        for(var a=1;a<s.childNodes.length;a++)
        {
            var zk=document.getElementById("zk_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).value;
            if(zk=="")//||parseFloat(zk)==0
            {
                alert("折扣不能为零或为空");return;
            }
            var sl=document.getElementById("sl_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).value;            
            var price=document.getElementById("p_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML;
            var weight=document.getElementById("w_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML;
            if(document.getElementById("hdaprice_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=="")
            {
                document.getElementById("hdaprice_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=price;
            }
            var sjdj=parseFloat(document.getElementById("hdaprice_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML)*zk;

            var bzjj=price*sl;
            var sjjj=0.00;
            var dzzl=weight*sl;
            if(document.getElementById("aprice_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=="")
            {
                document.getElementById("aprice_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=(price*zk).toFixed(2);
                sjjj=price*zk*sl;
            }
            else
            {
                document.getElementById("aprice_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=sjdj.toFixed(2);
                sjjj=sjdj*sl;
            }
            document.getElementById("samt_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=bzjj.toFixed(2);
            document.getElementById("aamt_"+s.childNodes[a].id+"_"+s.childNodes[a].childNodes[1].id).innerHTML=sjjj.toFixed(2);
            zje+=sjjj;
            zzl+=dzzl;
        }  
        
        //判断是否满足满X元送Y元促销
        $j.post("../Handler/OrderPromotionHandler.ashx",{RLJE:zje,OP:"CXFAD7"}, function(data){  
        
                if(data.length>1)     
                {                    
                    var temp=data.split(",");
                    document.getElementById("txtrlje").value=temp[0];
                    document.getElementById("HidRL_Promotion").value=temp[1];
                    
                }
                else
                {
                    if(document.getElementById("HidRL_Promotion").value.length>1)
                    {
                        document.getElementById("txtrlje").value=0;
                        document.getElementById("HidRL_Promotion").value="";
                    }
                }
                document.getElementById("div_zjj2").value=parseFloat(zje.toFixed(2))+parseFloat(document.getElementById("txtwlfy").value)-parseFloat(document.getElementById("txtrlje").value);
                });

        
        var oldzzl=document.getElementById("div_spzzl").value;
        if(parseFloat(oldzzl)!=zzl)
        {
            //订单数量修改后物流改为要重新选择,以前不重新选择会使程序进入死循环



    //        var wl=null;
            var wlobj=document.getElementsByName("Deliver");  
            for(var a=0;a<wlobj.length;a++)
            {
                wlobj[a].checked=false;
    //            if(wlobj[a].checked)
    //            {
    //                wl=wlobj[a];
    //                break;
    //            }
            }
    //        if(wl==null)
    //        {
                var wlobj2=document.getElementsByName("DeliverType");
                for(var a2=0;a2<wlobj2.length;a2++)
                {
                    wlobj2[a2].checked=false;
    //                if(wlobj2[a2].checked)
    //                {
    //                    wl=wlobj2[a2];
    //                    break;
    //                }
                }
    //        }  
    //        if(wl!=null){CalculateYF(wl);}    
         }
        document.getElementById("div_zjj").value=zje.toFixed(2);
        document.getElementById("div_zjj2").value=parseFloat(zje.toFixed(2))+parseFloat(document.getElementById("txtwlfy").value)-parseFloat(document.getElementById("txtrlje").value);
        document.getElementById("div_spzzl").value=zzl.toFixed(2); 
        HidMask();         

   }
   function removeRow(src)
   {
      src.parentNode.parentNode.parentNode.removeChild(src.parentNode.parentNode);Suan('');
   }       
 function btnstyle(p)
 {
 if(p==false)
 {
         //document.getElementById("abtn").style.display="none";
        //document.getElementById("div_sub").innerText="请稍候...";
        }
        else
        {
                document.getElementById("abtn").style.display="";
                document.getElementById("div_sub").innerText="";
        }
 }
function Clear(obj)
{
    if(obj.value=="区号"||obj.value=="号码"||obj.value=="分机")
    {
        obj.value="";
    }
}
function CheckAddress()
{//debugger;
    var reciver=document.getElementById("T_Name");
    if(reciver.value.length<1)
    {
        alert("收货人姓名不能为空");
        reciver.focus();
        return false;
    }
    var Province=document.getElementById("Province");
    if(Province.selectedIndex<1)
    {
        alert("请选择省份");
        Province.focus();
        return false;
    }
    var City=document.getElementById("City");
    if(City.selectedIndex<1)
    {
        alert("请选择城市");
        City.focus();
        return false;
    }
    var Area=document.getElementById("Area");
    if(Area.selectedIndex<1)
    {
        alert("请选择区县");
        Area.focus();
        return false;
    }
    var daddress=document.getElementById("Address");
    if(daddress.value.length<1)
    {
        alert("请填写具体地址");
        daddress.focus();
        return false;
    }
//    debugger;
    //why 09-07-01
    var post1=document.getElementById ("Post").value;
    document.getElementById ("Post").value=post1.replace(/\s/g,"");
    
    var post=document.getElementById("Post");
    if(isNaN(post.value))
    {
        alert("邮编格式错误,请检查您输入法的全角/半角状态！");
        post.focus();
        return false;
    }
    var regular=/^\d{6}$/;
    if(!regular.test(post.value))
    {
        alert("邮编不正确");
        post.focus();
        return false;
    }
    //why 09-07-01
    var Phone=document.getElementById("Phone").value;
    var Phone1=document.getElementById("Phone2").value;
    var Phone2=document.getElementById("Phone3").value;
    var Mobile=document.getElementById("Mobile").value;
    document.getElementById ("Phone").value=Phone.replace(/\s/g,"");
    document.getElementById ("Phone2").value=Phone1.replace(/\s/g,"");
    document.getElementById ("Phone3").value=Phone2.replace(/\s/g,"");
    document.getElementById("Mobile").value=Mobile.replace(/\s/g,"");
    
    var phone=document.getElementById("Phone");//区号
    var phone1=document.getElementById("Phone2");//电话号码
    var phone2=document.getElementById("Phone3");//分机号码
    var mobile=document.getElementById("Mobile");
    if((phone1.value.length==0||phone1.value=="号码")&&mobile.value.length==0)
    {alert("手机或固定电话必填一个"); return false;}
    
    if(phone.value.length>0&&phone.value!="区号"||phone1.value.length>0&&phone1.value!="号码"||phone2.value.length>0&&phone2.value!="分机")
    {//debugger;
    if((phone.value.length>0&&phone.value!="区号")||(phone1.value.length>0&&phone1.value!="号码"))
    {
        if(isNaN(phone.value)||isNaN(phone1.value))
        {
            alert("固定电话格式错误,请检查您输入法的全角/半角状态！");
            return false;
        }
        var reg=/^\d{3,4}$/;//检查区号

        var reg1=/^\d{7,8}$/;//检查电话号码

        if(!reg.test(phone.value)||!reg1.test(phone1.value))
        {
            alert("固定电话格式错误");
            return false;
        }
    }
    if(phone2.value.length>0&&phone2.value!="分机")
    {
        if(isNaN(phone.value)||isNaN(phone1.value)||isNaN(phone2.value))
        {
            alert("固定电话格式错误,请检查您输入法的全角/半角状态！");
            return false;
        }
        var reg=/^\d{3,4}$/;//检查区号

        var reg1=/^\d{7,8}$/;//检查电话号码

        var reg2=/^\d{1,5}$/;//检查分机号
        if(!reg.test(phone.value)||!reg1.test(phone1.value)||!reg2.test(phone2.value))
        {
            alert("固定电话格式错误");
            return false;
        }
    }
    }
    if(mobile.value.length>0)
    {
        if(isNaN(mobile.value))
        {
            alert("手机号码含有非法字符");
            mobile.focus();
            return false;
        }
        var reg=/^\d+$/;//检查手机

        if(!reg.test(mobile.value))
        {
            alert("请输入正确的手机号码");
            mobile.focus();
            return false;
        }
        /*
        var myreg = /^(((13[0-9]{1})|159|153)+\d{8})$/;
        var flag=myreg.test(mobile.value);
        if(!flag)
        {
            alert("手机号码格式错误");
            mobile.focus();
            return false;
        }
        */
    }
    return true;
}
   function save()
   {//debugger;
//   var s=document.getElementById("tabProduct");
//   alert(s.childNodes[1].childNodes[1].id);return;
        //btnstyle(false);
        var zfobj=document.getElementById("tabZF");
        var liQuanObj=document.getElementById("CouponList");//礼券表

        var guke=document.getElementById("TextBox2").value;
        if(guke==""){alert("请选择顾客");btnstyle(true);return;}
        var s=document.getElementById("tabProduct");
        
        if(s.childNodes.length<=1){alert("请选择商品");btnstyle(true);return;}
        var wl="";
        var wlobj=document.getElementsByName("Deliver");
        
        var province = "";
        var city = "";
        var area = "";
        
        var dropProvince = document.getElementById("Province");//-----------------------------------------------------------------------------------------------------------------
        if(dropProvince!=null)
        {
            for(var i=0;i<dropProvince.options.length;i++)
            {
                if(dropProvince.options[i].selected)
                {
                    province = dropProvince.options[i].value;
                    break;
                }
            }
        }
        
        var dropCity = document.getElementById("City");
        if(dropCity!=null)
        {
            for(var i=0;i<dropCity.options.length;i++)
            {
                if(dropCity.options[i].selected)
                {
                    city = dropCity.options[i].value;
                    break;
                }
            }
        }
        
        var dropArea = document.getElementById("Area");
        if(dropArea!=null)
        {
            for(var i=0;i<dropArea.options.length;i++)
            {
                if(dropArea.options[i].selected)
                {
                    area = dropArea.options[i].value;
                    break;
                }
            }
        }
        
        for(var a=0;a<wlobj.length;a++)
        {
            if(wlobj[a].checked)
            {
                wl=wlobj[a].value;
                break;
            }
        }
        var selectfp = document.getElementById("selectfp");
        var text1 = document.getElementById("Text1");
        var isFp=0;
        if(selectfp.options[1].selected)
        {
             if(text1.value=="")
             {
                alert("请填写发票抬头");return;
             }
             isFp=1;
        }
        
//        if(wl=="")
//        {
//            var wlobj2=document.getElementsByName("DeliverType");
//            for(var a2=0;a2<wlobj2.length;a2++)
//            {
//                if(wlobj2[a2].checked)
//                {
//                    wl=wlobj2[a2].value;
//                    break;
//                }
//            }
//        }  
//debugger;
        if(wl==""){alert("请选择物流公司");btnstyle(true);return;}         
        var spstr="";
        var spkcStr="";
        if(!CheckAddress()){return;}
        var shr=document.getElementById("T_Name").value;
        debugger;
        var dz=document.getElementById("Address").value.replace(/,/g," ");
        var phone0=document.getElementById("Phone");//区号
        var phone1=document.getElementById("Phone2");//电话号码
        var phone2=document.getElementById("Phone3");//分机号码
    
        var dh="";
        if(phone1.value.length>0&&phone1.value!="号码")
        {
            dh=phone0.value+"-"+phone1.value;            
        }
        if(phone2.value.length>0&&phone2.value!="分机")
        {
            dh=phone0.value+"-"+phone1.value+"-"+phone2.value;
        }
        //var dh=document.getElementById("Phone").value;
        var sj=document.getElementById("Mobile").value;
        var yb=document.getElementById("Post").value;
        var jylx=retselectById("selectJYLX");
        var ddly=retselectById("selectddly");
        var fyxz=retselectById("selectfyxz");
        var xyfp=retselectById("selectfp");   
        var rlje=document.getElementById("txtrlje").value==""?"0":document.getElementById("txtrlje").value;
        var wlfy=document.getElementById("txtwlfy").value==""?"0":document.getElementById("txtwlfy").value;
        var bz=document.getElementById("txtBZ").value;
        var ddcxbh=document.getElementById("HidRL_Promotion").value; //整单促销编号
        var zk=document.getElementById("TextBox1").value==""?"0":document.getElementById("TextBox1").value;
        for(var i=1;i<s.childNodes.length;i++)
        {
            var colorstr="";
            var sizestr="";
            var sl="1";
            var color=document.getElementById("color_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id);
            var size=document.getElementById("size_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id);
          
            var spzk=document.getElementById("zk_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value;
            if(spzk=="")//||parseFloat(spzk)==0
            {
                alert("折扣不能为零或为空");return;
            }
            sl=document.getElementById("sl_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value;
            colorstr=retselect(color);
            if(colorstr=="-1")
            {
                alert("请选择颜色");return;
            }
            sizestr=retselect(size);  
            if(sizestr=="-1")
            {
                alert("请选择尺码");return;
            }
            
            var price=document.getElementById("p_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).innerHTML;
            var aprice=document.getElementById("aprice_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).innerHTML;
            var weig=document.getElementById("w_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).innerHTML;
             
            var rowid=s.childNodes[i].id;               //行ID
            var cxdh=document.getElementById("HidPromotion_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value;   //促销编号
            var yhfs=document.getElementById("HidYHFS_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value;        //优惠方式
            var parent=document.getElementById("HidParent_"+s.childNodes[i].id+"_"+s.childNodes[i].childNodes[1].id).value;    //礼品时存的是送此礼品的商品行ID
            spstr+=s.childNodes[i].childNodes[1].id+","+colorstr+","+sizestr+","+sl+","+price+","+spzk+","+weig+","+rowid+","+cxdh+","+yhfs+","+parent+","+aprice+"#";
            spkcStr+=s.childNodes[i].childNodes[1].id+","+colorstr+","+sizestr+","+sl+"$";
        }
        
        var zfstr="";
        for(var z=1;z<zfobj.childNodes.length;z++)
        {
            var zhanghao=zfobj.childNodes[z].childNodes[1].childNodes[0].value;
            var zf_jylx=retselect(zfobj.childNodes[z].childNodes[2].childNodes[0]);
            var zfdm=retselect(zfobj.childNodes[z].childNodes[3].childNodes[0]);
            var isNeedDealCode = ValidIsNeedDealCode(zfobj.childNodes[z].childNodes[3].childNodes[0]);
            var zfje=zfobj.childNodes[z].childNodes[4].childNodes[0].value;
//            var zfrq=zfobj.childNodes[z].childNodes[4].childNodes[0].value;
            var jyh=zfobj.childNodes[z].childNodes[5].childNodes[0].value;
            var jyrq=zfobj.childNodes[z].childNodes[6].childNodes[0].value;
            var zfbz=zfobj.childNodes[z].childNodes[7].childNodes[0].value;
            if(isNeedDealCode=="1")
            {
                if(jyh=="")
                {
                    alert("您选择的支付方式必须输入交易号，请输入！");btnstyle(true);return;
                }
            }
            zfstr+=zhanghao+","+zfdm+","+zfje+","+zf_jylx+","+jyh+","+jyrq+","+zfbz+"#";
        } 
          
          
       if(liQuanObj!=null)
       {   
           for(var i=1;i<liQuanObj.rows.length;i++)
           {//礼券支付明细
               if(liQuanObj.rows[i].cells[0].firstChild.checked)
               {
                var zhanghao="";
                var zf_jylx="001";
                var zfdm="001";
                var zfje=liQuanObj.rows[i].cells[2].innerHTML;
                var jyh=liQuanObj.rows[i].cells[1].innerHTML;
                var jyrq=formatdate(new Date(),true);
                var zfbz="";
                zfstr+=zhanghao+","+zfdm+","+zfje+","+zf_jylx+","+jyh+","+jyrq+","+zfbz+"#";
                }           
           }  
       }
        spstr=spstr.substring(0,spstr.length-1);
        spkcStr=spkcStr.substring(0,spkcStr.length-1);
        spstr=guke+","+shr+","+dz+","+dh+","+sj+","+yb+","+jylx+","+ddly+","+fyxz+","+xyfp+","+rlje+","+wl+","+wlfy+","+bz+","+isFp+","+text1.value+","+province+","+city+","+area+","+ddcxbh+","+zk+"|"+spstr;
        if(zfstr.length>0)
        {
            zfstr=zfstr.substring(0,zfstr.length-1);
            spstr+="|"+zfstr;
        }    
        
        arg = spstr;
          $j.post("../Handler/VIPHandler.ashx?spkcstr="+spkcStr,null, function(data){       

            if(data=="")
            {
                 if(window.confirm("可用库存不足,是否确定生成订单？"))
                    {
                        <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "")%>; 
                    }
                    else
                    {
                        btnstyle(true);return;
                    }
            }
            else
            {
                <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "")%>; 
            }

        });        

   }
 function ReceiveServerData(result)   
 {  
    var rev=result.split(",");
     switch (rev[1])
     {
        case "false":
                alert(rev[0]);btnstyle(true);return;
            break;
        case "true":
            window.location.href="OrderDetail.aspx?t=1&code="+rev[0];
            break;
     }
 }    
    function retselectById(objid)
   {
        var s=document.getElementById(objid);
        var value="";
        for(var a=0;a<s.options.length;a++)
        {
            if(s.options[a].selected)
            {
                value=s.options[a].value;
                break;
            }
        }    
        return value;    
   }
   function retselect(s)
   {
        var value="";
        for(var a=0;a<s.options.length;a++)
        {
            if(s.options[a].selected)
            {
                value=s.options[a].value;
            }
        }    
        return value;    
   }
   
   function ValidIsNeedDealCode(s)
   {
        var lang="";
        for(var a=0;a<s.options.length;a++)
        {
            if(s.options[a].selected)
            {
                lang=s.options[a].lang;
            }
        }    
        return lang;    
   }
function SubmitKeyClick() 
{    
if (event.keyCode == 13) 
{      
   event.keyCode=9;
   event.returnValue = false;
   
             $j.post("../Handler/VIPHandler.ashx?accountcode="+document.getElementById("TextBox2").value,null, function(data){       
            if(data=="")
            {
                SearchVIP('../');
            }
            else
            {
                var arr=data.split(",");
                document.getElementById("TextBox2").value=arr[0];
                document.getElementById("TextBox1").value=arr[1];
                document.getElementById("TextBox3").value=arr[2];
                document.getElementById("TextBox4").value=arr[3];
                document.getElementById("div_dzlb").style.display=""; 
                document.getElementById("AddressList").innerHTML="";
                AddressInit(arr[0]);
                LiQuanInit(arr[0]);
                               
            }

        });       
}
}	
function jylx_zffs(divobj)
{
        var jy=divobj.options[divobj.selectedIndex].value;
          $j.post("../Handler/OrderProductHandler.ashx?jy_zf=1&jylx="+jy,null, function(data){       
            divobj.parentNode.parentNode.childNodes[3].innerHTML=data;
        });
    
}

function getAccount(control)
{
    var payType=control.options[control.selectedIndex].value;
        $j.post("../Handler/OrderProductHandler.ashx?paytype="+payType,null, function(data){       
            control.parentNode.parentNode.childNodes[1].childNodes[0].value=data;
        });
}

function SetTextVisible(control)
{
    var drop = control;
    var text = document.getElementById("Text1");
    
    if(drop.options[0].selected)
    {
        text.style.display="none"; 
    }
    else
    {
        text.style.display="inline"; 
        
    }
}
//选择活动
function ChooseHD(obj)
{
    MastCart();
    var row=obj.offsetParent.offsetParent;
    $j.post("../Handler/OrderPromotionHandler.ashx",{SPDM:row.childNodes[1].id,ROW:row.id,OP:"GetPromotion"}, function(data){       
            document.getElementById("ShoppingCart").innerHTML=data;
        });   
}
function HDSubmit()
{//debugger;
   var row=document.getElementById("Hid_Row").value;
   var spdm=document.getElementById("Hid_SP").value;
   var slinput=document.getElementsByTagName("input");
   var cxdh="";
   var yhfs="";
   var zk=0;//活动折扣
   var je=0;
   var qyhyzk=0;//是否启用会员折扣
   if(slinput!=null)
    {
        for(var j=0;j<slinput.length;j++)
        {
            var sp=slinput[j];
            if(sp.name=="Promotion")
            {
                if(sp.checked)
                {
                  cxdh=sp.value;
                  var tmp=sp.title.split(",");                  
                  yhfs=tmp[0];
                  zk=parseFloat(tmp[1]);
                  je=parseFloat(tmp[2]);
                  qyhyzk=parseFloat(tmp[3]);
                }
            }        
        }
    }
    document.getElementById("HidPromotion_"+row+"_"+spdm).value=cxdh;
    document.getElementById("HidYHFS_"+row+"_"+spdm).value=yhfs;
       
    var ozk=document.getElementById("zk_"+row+"_"+spdm).value
    if(yhfs=="1")
    {
        if(qyhyzk==0)
        {
            document.getElementById("zk_"+row+"_"+spdm).value=zk;
            document.getElementById("aprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)*zk;
            document.getElementById("hdaprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)*zk;
        }
        else
        {
            var nzk=zk;
            document.getElementById("zk_"+row+"_"+spdm).value=nzk;
            document.getElementById("aprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)*nzk;
            document.getElementById("hdaprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)*nzk;
        }
        Suan("");
    }
    if(yhfs=="2")
    { //debugger;
        document.getElementById("zk_"+row+"_"+spdm).readOnly=true;
        if(qyhyzk==0)
        {
           document.getElementById("zk_"+row+"_"+spdm).value="1.00";
           document.getElementById("aprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)-je;
           document.getElementById("hdaprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)-je;
        }
        else
        {
           document.getElementById("zk_"+row+"_"+spdm).value=parseFloat(ozk);
           document.getElementById("aprice_"+row+"_"+spdm).innerHTML=(parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)-je); 
           document.getElementById("hdaprice_"+row+"_"+spdm).innerHTML=(parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML)-je);         
        }
       Suan("");
    }
    if(yhfs=="3")
    {       
        document.getElementById("zk_"+row+"_"+spdm).readOnly=true;
        if(qyhyzk==0)
        {
           document.getElementById("zk_"+row+"_"+spdm).value="1.00";
           document.getElementById("aprice_"+row+"_"+spdm).innerHTML=document.getElementById("p_"+row+"_"+spdm).innerHTML;
           document.getElementById("hdaprice_"+row+"_"+spdm).innerHTML=document.getElementById("p_"+row+"_"+spdm).innerHTML;
        }
        else
        {
           document.getElementById("zk_"+row+"_"+spdm).value=parseFloat(ozk); 
           document.getElementById("aprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML);   
           document.getElementById("hdaprice_"+row+"_"+spdm).innerHTML=parseFloat(document.getElementById("p_"+row+"_"+spdm).innerHTML); 
        }
       document.getElementById("LP_"+row).style.display="block";
    }
    document.getElementById("HD_"+row).style.display="none";
    HidCart();
}
function HDCancel()
{
    HidCart();
}
//选择礼品
function ChooseLP(obj)
{
   var row=obj.offsetParent.offsetParent;
   var BPD_ID=row.id;     //行ID
   var SPDM=row.childNodes[1].id;   //商品编号
   var CXDH=document.getElementById("HidPromotion_"+BPD_ID+"_"+SPDM).value;   //促销单号
   var BuySl=document.getElementById("sl_"+BPD_ID+"_"+SPDM).value     //购物数量
   var HAS;//已经选礼品数量



   var slinput=document.getElementsByTagName("input");
   var aa=0;
   if(slinput!=null)
    {
        for(var j=0;j<slinput.length;j++)
        {
            var sp=slinput[j];
            if(sp.id.substr(0,9)=="HidParent")
            {   
                
                if(sp.value==BPD_ID)             
                {
                    
                    
                    //var index=sp.id.indexOf("_");
                    //var lastindex=sp.id.lastIndexOf("_")
                    //var sl=sp.id.substr(index+1,lastindex-index+1);
                    aa=aa+1;
                }
            }        
        }
    }
    HAS=aa;    
    
    MastCart();
     $j.post("../Handler/OrderPromotionHandler.ashx",{BPD_ID:BPD_ID,CXDH:CXDH,SPDM:SPDM,SL:BuySl,HAS:HAS,OP:"Choose"}, function(data){       
            document.getElementById("ShoppingCart").innerHTML=data;
            
        });   
}
//礼品加入订单明细
function AddChooseGift(row)
{     
    var sprows=document.getElementById("Hid_SpRows").value; //商品明细总行数



    var slinput=document.getElementsByTagName("input");    
    var lpdm;    //礼品DM
    if(slinput!=null)
    {
        for(var j=0;j<slinput.length;j++)
        {
            var sp=slinput[j];
            if(sp.checked)
            {
                if(sp.id.substr(0,3)=="CK_")
                {                    
                    var index=sp.id.indexOf("_");
                    lpdm=sp.id.substr(index+1,sp.id.length-index-1);
                }      
            }  
        }
    }
    var LPMC=document.getElementById("HidLP_"+lpdm).value; //礼品名称
     
    var sendsl=document.getElementById("Hid_SL").value; //活动可送数量



    var hassl=document.getElementById("Hid_HasSL").value;//已送数量



    var buysl=document.getElementById("Hid_BuySL").value;//购物数量
    alert(sendsl+","+hassl+","+buysl);
    if(parseInt(sendsl)*parseInt(buysl)>parseInt(hassl))
    {
        document.getElementById("div_loadding").innerHTML = "<span >Loading  <img src='../Include/Images/loadimg.gif'></span>";
        $j.post("../Handler/OrderPromotionHandler.ashx",{Rows:sprows,CurrentIndex:row,LPDM:lpdm,LPMC:LPMC,OP:"AddLP"}, function(data){       
        addRow(data);
        HidCart();
        document.getElementById("div_loadding").innerHTML ="";
            });
    }
    else
    {
        alert("购买"+buysl+"件此商品，只能送"+parseInt(sendsl)*parseInt(buysl)+"件礼品,而且你已经选了"+hassl+"件礼品");
    }
}
function MastCart()
{
    var div_back = document.getElementById("div_background");
    div_back.style.display = "block"; 
    var iframe_back = document.getElementById("iframe_back");
    iframe_back.style.display = "block";     
    var cart = document.getElementById("ShoppingCart");
    cart.style.display = "block";
    cart.style.position = "absolute";
    var bigImg = document.getElementById("Hid_SpRows");
    var pleft = 0;
    var ptop = 0;
   
    var obj = bigImg.offsetParent;
 
    while(obj.tagName != "BODY")
    {
         pleft = pleft + obj.offsetLeft;
         ptop = ptop + obj.offsetTop;
         obj = obj.offsetParent;
    }
    ptop = ptop +100;
    cart.style.left = pleft +200+ "px";
    cart.style.top = ptop +"px";
    cart.style.width = 500 + "px";
    cart.style.backgroundColor  = "#ffffff";
}
function HidCart()
{
    var div_back = document.getElementById("div_background");
    div_back.style.display = "none"; 
    var iframe_back = document.getElementById("iframe_back");
    iframe_back.style.display = "none";   
    var cart = document.getElementById("ShoppingCart");
    cart.style.display = "none";    
}
function SingleChoose(obj)
{
    var inputlist=document.getElementsByTagName("input"); 
    for(var i=0;i<inputlist.length;i++)
    {
        if(inputlist[i]!=obj)
        {
            inputlist[i].checked=false;
        }
    }
}
function addZF()
{debugger;
    var sumZF=0.00;
    var tabZF=document.getElementById("tabZF");
    for(var i=1;i<tabZF.childNodes.length;i++)
    {
        sumZF+=parseFloat(tabZF.childNodes[i].childNodes[4].childNodes[0].value);
    }
    var SumZF=document.getElementById("SumZF");
    SumZF.childNodes[0].childNodes[4].innerText=sumZF;
}
function CheckDigit(ctl,str)
{
    var reg="^[0-9]*$";
    var value=ctl.value;
    if(!value.match(reg))
    {   
        ctl.value="";
        ctl.focus();
        alert(str);
    }
}
    </script>

    <script type="text/javascript" src="../Include/Js/OpenWindow.js"></script>

    <style type="text/css">
body {font-size:12px;margin:0;padding:0;}
.btlj {background: url(../Include/Images/bt1.gif) no-repeat; width:74px; height:23px;text-align:center; padding-top:5px; font-size:12px;float:left;margin-left:5px;display:inline;}
.btlj a{color:#000000; text-decoration:none;}
.btlj a:hover{color:#FF3300;text-decoration:underline;}
a.btlj1{background: url(../Include/Images/bt.gif) no-repeat; width:52px; height:23px;text-align:center; padding-top:5px;font-size:12px;float:left;margin-left:5px;display:inline;}
a.btlj1 :link{color:#000000; text-decoration:none;}
a.btlj1 :hover{color:#FF3300;text-decoration:underline;}
.menu {float:left; width:98px;text-align:center;margin:0;}
.menu1 {float:left; width:140px;text-align:center;}
h4 {width:1200px;background-color:#cccccc;text-align:left;margin:10px 0 10px 0; padding-top:5px;padding-bottom:5px;border:#CCCCCC 0px solid; font-size:12px;padding-left:20px;}
.r_bgcolor4 {background-color:#F1F1F1; font-weight:600; text-align:center; padding-top:5px;padding-bottom:5px;border:#CCCCCC 1px solid;}
.inputw{width:60px;height:13px;text-align:right;}
.inputw0{width:100px;height:13px;text-align:right;}
.inputw1{width:124px;height:13px;text-align:right;}
.inputw2{width:180px;height:13px;text-align:left;}
.inputw3{width:124px;height:13px;text-align:left;}
.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid;width:1200px;clear:left;}
.menu_bg1 { background-color:#f5f5f5; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cccccc 1px solid;border-top:#cccccc 1px solid;width:1200px;clear:left;}
.menu_bg2 {width:1200px;background-color:#cccccc;text-align:left;margin:10px 0 10px 0;padding-top:5px;border:#CCCCCC 0px solid; font-size:12px;padding-left:20px;}
.menu_bg3 {width:1200px;background-color:#cccccc;text-align:left;margin:0 0 10px 0;padding-top:5px;border:#CCCCCC 0px solid; font-size:12px;padding-left:20px;}
.ld {margin-left:20px;}
.d1 {float:left;margin-bottom:2px;clear:left;}
.r_xinxi {float:left;clear:left;}
.table {padding-left:20px;}
.index {width:1200px; margin:0; padding-left:0;border-top:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;}
.indexdh {width:1200px; height:25px; margin:0; padding:0;}
.indexthleft {background-position: center top;width:90px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft7 {background-position: center top;width:80px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft8 {background-position: center top;width:81px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft5 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft6 {background-position: center top;overflow:hidden;width:214px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft2 {background-position: center top;width:80px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthright {background-position: center top;width:104px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.indexthright2 {background-position: center top;width:104px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;border-bottom:#999999 1px solid;}
.indexthleft1 {background-position: center top;width:90px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft3 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthleft4 {background-position: center top;width:214px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.indexthright1 {background-position: center top;width:111px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.indexthright2 {background-position: center top;width:81px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;border-bottom:#999999 1px solid;}
.indexthright3 {background-position: center top;width:81px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.indexthright4 {background-position: center top;width:150px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.xindex {width:1047px; margin:0; padding-left:0;border-top:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;}
.xindexdh {width:1047px; height:25px; margin:0; padding:0;}
.xindexthleft {background-position: center top;width:134px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.xindexthleft4 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.xindexthright5 {background-position: center top;width:200px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.xindexthleft2 {background-position: center top;width:120px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.xindexthright {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.xindexthright2 {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;border-bottom:#999999 1px solid;}
.xindexthleft1 {background-position: center top;width:134px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.xindexthleft5 {background-position: center top;width:120px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.xindexthleft3 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-right:#999999 1px solid;border-bottom:#999999 1px solid;}
.xindexthright1 {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.xindexthright3 {background-position: center top;width:200px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;}
.xindexthright4 {background-position: center top;width:150px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;border-bottom:#999999 1px solid;border-left:#999999 1px solid;}
a.lj {font-size:12px; color:#ff3300; text-decoration:underline;}
a.lj:link {font-size:12px; color:#ff3300; text-decoration:underline;}
a.lj:visited {font-size:12px; color:#ff3300; text-decoration:underline;}
a.lj:hover {color:#ff3300;}
a.lj:active {color:#ff3300;}
h2 {padding-left:20px;padding-top:10px;margin:0; background: url(../Include/Images/menu_title.gif) repeat-x;height:21px;font-size:14px; font-weight:600; width:1200px;}
.jiacu {float:left; font-weight:bold;padding-top:5px;}
.jiacu1 {float:left;}
.input_button {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;}
.divbackground
{
z-index:9;display:none;position:absolute;width:1120px;height:1040px;left:0px;top:0px;background-color:#F0F3F4;opacity: 0.5;filter:alpha(opacity=50,finishopacity=50,style=1);}

.diviframe
{
	display:none;position:absolute;z-index:10;width:expression(this.nextSibling.offsetWidth);height:expression(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression(this.nextSibling.offsetLeft);
}
.juzhong {text-align:center; border:#cf994b 1px solid; background:#fef3bb; width:200px; height:100px; padding-top:20px; margin-left:150px;}
.juzhong1 {margin:20px 0 10px 40px;}
.juzhong2 {margin-left:50px;}
.r_bgcolor {background-color:#fef3bb; font-weight:600; text-align:center; line-height:28px;}
.r_bgcolor1 {background-color:#fef3bb; text-align:center; line-height:22px; height:22px;}
.r_weizhi {padding-top:5px; padding-left:145px;}
</style>
</head>
<body onload="GetddlyList();AddressInit('0');">
    <form id="form1" runat="server">
        <h2>
            新增订单</h2>
        <div class="ld" id="div_loadding">
        </div>
        <div class="menu_bg1">
            <div class="d1">
                会员帐号：<asp:TextBox ID="TextBox2" runat="server" Style="width: 93px;"></asp:TextBox></div>
            <div class="d1">
                真实姓名：<asp:TextBox ID="TextBox3" runat="server" Style="width: 93px;"></asp:TextBox></div>
            <div class="d1">
                用户昵称：<asp:TextBox ID="TextBox4" runat="server" Style="width: 93px;"></asp:TextBox></div>
            <div class="d1">
                会员折扣：<asp:TextBox ID="TextBox1" runat="server" Style="width: 93px;"></asp:TextBox></div>
            <div class="d1">
                货到付款：<select id="selectJYLX" style="width: 99px;">
                    <option selected="selected" value="0">非货到付款</option>
                    <option value="1">货到付款</option>
                </select></div>
            <div class="d1">
                订单来源：<span id="div_ddly"></span></div>
            <div class="d1">
                费用性质：<select id="selectfyxz" style="width: 99px;" disabled="disabled">
                    <option value="001">我方承担</option>
                    <option selected="selected" value="002">客户承担</option>
                </select></div>
            <div class="d1">
                需要发票：<select id="selectfp" style="width: 99px;" runat="Server" onchange="SetTextVisible(this)">
                    <option selected="selected" value="0">不</option>
                    <option value="1">是</option>
                </select><br />
                <input id="Text1" type="text" runat="server" style="display: none"  />
            </div>
            <div>
                　　　　让利金额：<input style="width: 73px;" type="text" id="txtrlje" onblur="Suan('');" value="0" />
                <input id="HidRL_Promotion" type="hidden" />
                </div>
            <div>
                　　　　物流费用：<input style="width: 73px;" type="text" id="txtwlfy"  disabled="disabled" onblur="Suan('');" value="0" /><asp:Label
                    ID="lbl_freestandard" runat="server" Text=""></asp:Label><input id="Hid_Free" type="hidden"
                        runat="server" /><input id="Hid_Standard" type="hidden" /></div>
            <div>
                　　　商品总金额：<input id="div_zjj" style="width: 73px;" disabled="disabled" type="text" value="0" /></div>
            <div>
                　　　　实际金额：<input id="div_zjj2" style="width: 73px;" disabled="disabled" type="text" value="0" /></div>
            <div>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商品总重量：<input
                    id="div_spzzl" style="width: 73px;" disabled="disabled" type="text" runat="server"
                    value="0" /></div>
            <div>
                <div style="float: left;">
                    　　　　　　　&nbsp;&nbsp;&nbsp;备注：</div>
                <input type="textarea" id="txtBZ" value="" style="width: 243px; height: 73px" /></div>
        </div>
        <div class="menu_bg3">
            <span class="jiacu">商品明细</span><div class="btlj">
                <a href="javascript:void(0);" onclick="SearchProduct('../');">选择商品</a></div>
        </div>
        <div class="table">
            <div class="index" id="tabProduct">
                <div class="indexdh">
                    <!--该div标记不要删除-->
                    <div class="indexthleft3" style="font-weight: bold;">
                        删除</div>
                    <div class="indexthleft4" style="font-weight: bold;">
                        商品名称</div>
                    <div class="indexthleft1" style="font-weight: bold;">
                        颜色</div>
                    <div class="indexthleft1" style="font-weight: bold;">
                        尺码</div>
                    <div class="indexthleft1" style="font-weight: bold;">
                        数量</div>
                    <div class="indexthleft7" style="font-weight: bold;">
                        标准单价</div>
                    <div class="indexthleft1" style="font-weight: bold;">
                        折扣</div>
                    <div class="indexthleft7" style="font-weight: bold;">
                        实际单价</div>
                    <div class="indexthleft7" style="font-weight: bold;">
                        标准金额</div>
                    <div class="indexthleft7" style="font-weight: bold;">
                        实际金额</div>
                    <div class="indexthleft8" style="font-weight: bold;">
                        重量</div>
                    <div class="indexthright4" style="font-weight: bold;">
                        活动</div>
                </div>
            </div>
            <div>
                <input id="Hid_SpRows" type="hidden" value="0" /></div>
        </div>
        <div id="SendMethod">
            <h4>
                收货信息</h4>
        </div>
        <div style="width: 98%;">
            <div style="float: left;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="right" style="width: 10%; height: 24px;">
                            收货人姓名：</td>
                        <td style="height: 24px">
                            <input class="inputbox" id="T_Name" type="text" size="15" name="txtOldPwd" /></td>
                    </tr>
                    <tr>
                        <td align="right">
                            地址：</td>
                        <td align="left">
                            <select id="Province" onchange="GetCityList(this.value)">
                                <option></option>
                            </select>
                            <select id="City" onchange="GetAreaList(this.value)">
                                <option>请选择</option>
                            </select>
                            <select id="Area" onchange="ClearWLGS()">
                                <option>请选择</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top">
                            详细地址：</td>
                        <td>
                            <input class="inputbox" id="Address" type="text" style="width: 500px; height: 15px"
                                name="txtNewPwd1" />*</td>
                    </tr>
                    <tr>
                        <td align="right" style="height: 24px">
                            邮编：</td>
                        <td style="height: 24px">
                            <input class="inputbox" id="Post" type="text" size="15" name="txtNewPwd1" /></td>
                    </tr>
                    <tr>
                        <td align="right">
                            固定电话：</td>
                        <td>
                        <input class="inputbox" id="Phone" type="text" size="5" name="txtNewPwd1" value="区号" onfocus="Clear(this)" />
                        <input class="inputbox" id="Phone2" type="text" size="14" name="txtNewPwd2" value="号码" onfocus="Clear(this)" />
                        <input class="inputbox" id="Phone3" type="text" size="14" name="txtNewPwd3" value="分机" onfocus="Clear(this)" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            手机：</td>
                        <td>
                            <input class="inputbox" id="Mobile" type="text" size="15" name="txtNewPwd2" /></td>
                    </tr>
                </table>
                <div align="center"><input id="addAddress" type="button" value="加入地址" onclick="AddNewAddressBack()"/></div>
            </div>
            <!--地址列表-->
            <div id="div_dzlb" class="r_address_list" style="display: none; float: right;">
                <table width="810px" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td id="AddressList" style="height: 15px">
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <!-- 物流公司 -->
        <div id="Div1">
            <h4>
                配送方式</h4>
        </div>
        <div style="padding-left: 10px;">
            <%=WLGS%>
        </div>
        <br />
        <div id="div_wl">
        </div>
        
        <div class="menu_bg2">
            <span class="jiacu">支付明细</span><div class="btlj">
                <a href="javascript:void(0);" onclick="GetZFList();">新增支付</a></div>
        </div>
        <div class="table">
            <div class="xindex" id="tabZF">
                <div class="xindexdh">
                    <!--该div标记不要删除-->
                    <div class="xindexthleft3" style="font-weight: bold;">
                        删除</div>
                    <div class="xindexthleft1" style="font-weight: bold;">
                        帐号</div>
                    <div class="xindexthleft5" style="font-weight: bold;">
                        交易类型</div>
                    <div class="xindexthleft5" style="font-weight: bold;">
                        支付方式</div>
                    <div class="xindexthleft1" style="font-weight: bold;">
                        支付金额</div>
                    <div class="xindexthleft1" style="font-weight: bold;">
                        交易号</div>
                    <div class="xindexthleft1" style="font-weight: bold;">
                        交易日期</div>
                    <div class="xindexthright3" style="font-weight: bold;">
                        备注</div>
                </div>
            </div>
            <div class="xindex" id="SumZF">
            <div class="xindexdh">
            <div class="xindexthleft4">总计</div>
            <div class="xindexthleft">--</div>
            <div class="xindexthleft2" id="div_jy_lx">--</div>
            <div class="xindexthleft2" id="div_zf_fs">--</div>
            <div class="xindexthleft">0</div>
            <div class="xindexthleft">--</div>
            <div class="xindexthleft">--</div>
            <div class="xindexthright5">--</div>
            </div>
            </div>
        </div>
        <br />
        <div class="menu_bg2"><span class="jiacu">礼券支付</span></div>
        <div class="juli" id="LiQuanList"></div>
        <div class="menu_bg">
            <div style="display: none;" class="btlj">
            </div>
            <div id="div_sub">
            </div>
            <%--<a href="Javascript:" onclick="save()">生成订单</a>--%>
            <asp:LinkButton ID="abtn" CssClass="btlj" runat="server" Width="75px" Height="18px"
                Text="生成订单" OnClientClick="save();return false;" />
            <asp:HiddenField ID="Hiddeniscancle" runat="server" />
        </div>
        <asp:HiddenField ID="HiddenField1" runat="server" />
        <div id="div_background" class="divbackground" >
        </div>
        <iframe id="iframe_back" class="diviframe" frameborder="0"></iframe>
        <div id="ShoppingCart" style="z-index: 11; display: none">
        </div>
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
    </form>
</body>
</html>
